let dateServer = value => {
    let timestamp = Date.parse(new Date())
    let val1 = timestamp - value
    if(val1 > 86400000){
        return value = new Date(parseInt(value)).toJSON().slice(0,10)
    }else if(val1 > 3600000){
        return value = parseInt((val1 % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60)) + '小時前'
    }else if(val1 < 60000){
        return value = '剛剛'
    }else{
        return value = parseInt((val1 % (1000 * 60 * 60)) / (1000 * 60))+ '分鐘前'
    }
  }

export { dateServer }